<?php
/**
 * Copyright 2011  SURFfoundation
 * 
 * This file is part of ESCAPE.
 * 
 * ESCAPE is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * ESCAPE is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with ESCAPE.  If not, see <http://www.gnu.org/licenses/>.
 * 
 * For more information:
 * http://escapesurf.wordpress.com/
 * http://www.surffoundation.nl/
 * 
 * Contact: d.vierkant@utwente.nl
 * 
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3
 */
?>
<?php
	/* @var $repositoryUi escape_repositoryui_RepositoryUi */
	$repositoryUi =& $this->requestAttributes['repositoryUi'];

	$user = $repositoryUi->getUser();
	
	$templateVariables = array();
	$templateVariables['title'] = 'Create ' . $repositoryUi->repository->config['label_aggregation'];
	$this->requestAttributes['templateVariables'] =& $templateVariables;
?>
<?php $this->displayHeader(); ?>

<div class="escape_Section">

<div class="escape_Selection">

<div class="escape_SectionTitle">Create a new <?php print htmlspecialchars($repositoryUi->repository->config['label_aggregation']); ?></div>

<p>Please fill in the details below</p>

<form method="get" action="#" onsubmit="return false">
<table class="escape_FormTable">
<tr>
<td>
Title:
</td>
<td>
<input type="text" name="title" size="50" />
</td>
</tr>
<tr>
<td>
Creator:
</td>
<td>
<input type="text" name="creator" size="50" value="<?php print htmlspecialchars($user->getName()); ?>" />
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" onclick="var title = $(this).form.title.value; var creator = $(this).form.creator.value; if(!title) { alert('Please fill in a title'); return false; }; if(!creator) { alert('Please fill in a creator'); return false; } escape_escapeUi.doRpcJsonRequest('CreateOreAggregation', {title: title, creator: creator}, escape_escapeUi.redirectToResourceByUri.curry('show')); return false" value="Create <?php print htmlspecialchars($repositoryUi->repository->config['label_aggregation']); ?>" />
<button onclick="escape_escapeUi.redirectToResourceById('me'); return false">Cancel</button>
</td>
</tr>
</table>
</form>

</div>

</div>

<?php $this->displayFooter(); ?>
